from config.configs import DB_CONNECTION_INFO
from sqlalchemy import  create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

db_url = f'postgresql://{DB_CONNECTION_INFO["user"]}:{DB_CONNECTION_INFO["password"]}@{DB_CONNECTION_INFO["host"]}:{DB_CONNECTION_INFO["port"]}/{DB_CONNECTION_INFO["database"]}'

connect_args = {}
engine = create_engine(db_url, pool_recycle=14400, pool_size=100, max_overflow=200, echo=True)

SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Base = declarative_base()